package com.personal.o2o.service;

import java.util.List;

import com.personal.o2o.dto.ImageHolder;
import com.personal.o2o.dto.ProductExecution;
import com.personal.o2o.entity.Product;
import com.personal.o2o.exceptions.ProductOperationException;
import org.springframework.web.multipart.commons.CommonsMultipartFile;

public interface ProductService {

	/**
	 * 查询商品列表并分页，可输入条件有:商品名(模糊)，商品状态，店铺ID，商品类别
	 * @param productCondition
	 * @param pageIndex
	 * @param pageSize
	 * @return
	 */
	ProductExecution getProductList(Product productCondition, int pageIndex, int pageSize);

	/**
	 * 通过商品的ID查询唯一信息
	 * @param productId
	 * @return
	 */
	Product getProductById(long productId);

	/**
	 * 添加商品信息以及图片处理
	 * @param product
	 * @param thumbnail
	 * @param productImgs
	 * @return
	 * @throws RuntimeException
	 */
	ProductExecution addProduct(Product product, ImageHolder thumbnail, List<ImageHolder> productImgs)
			throws RuntimeException;

	ProductExecution modifyProduct(Product product,
								   ImageHolder thumbnail,
                                   List<ImageHolder> productImgs) throws ProductOperationException;
}
